<!--交易记录-->

<template>
	<div>
		<div class="my_header">
			<i class="mui-icon mui-icon-arrowleft" aria-hidden="true" @click="$router.back(-1)"></i>
			<div class="top1">交易记录</div>
			
		</div>
		<div class="jyrecord">
			<div v-for="item in jyrecordlist">
			<div class="row" @click="gojydetail(item.transaction_id)">
				
				<div class="left">交易记录</div>
				<div class="right" :class="item.status=='-'?'blue':'red'">{{item.status}}￥{{item.money}}<img src="static/imgs/icon_more.png"></div>
			
			</div>
			</div>
			
		</div>
		
	</div>
	
</template>

<script>
	export default {

		data() {
			return {
		
				jyrecordlist:[],
				


			};
		},
		created: function() {
			var token = localStorage.getItem("token");
			var that = this;

			that.jyrecord(token);
		},
		methods: {
			gojydetail(aa){
				var that=this;
				
				that.$router.push({
					path: './tractiondetal',
					query: {
						tabitem: aa
						
					}
				});
			},
			
			gocener() {
				var that = this;
				if(that.usertype == 1) {
					that.$router.push({
						path: './Personalcenter'

					});
				} else {
					that.$router.push({
						path: './corporatecenter'

					});
				}
			},

			jyrecord() {
				var that = this;
				$.ajax({
					type: "get",
					url: "http://zcapi.hrgsxt.cn/api/User_account/transaction",
					data: {
						token: localStorage.getItem("token"),

					},
					cache: false,
					dataType: "json",
					success: function(data) {
						console.log(JSON.stringify(data.data));
						if(data.code == 200) {
                           
                             	that.jyrecordlist=data.data;
                             
							console.log(JSON.stringify(that.jyrecordlist));

						} else {

							that.$toast({
								message: data.message,
								duration: 1000
							})

						}

					}
				});
			}

		},

		watch: {
			// 如果路由有变化，会再次执行该方法
			'$route': 'fetchData'
		}
	}

	//图片上传并预览
</script>

<style scoped>

	.red{
		color: #FF7E00 !important;
	}
	.blue{
		color:#0085F0 !important;
	}
	/*头部*/
		.my_header {
		height: .88rem;
		background: rgba(0, 133, 240, 1);
		text-align: center;
		color: #fff;
		line-height: .88rem;
		position: relative;
		padding: 0 .3rem;
	}
	

	
	.my_header i {
		font-size: .4rem;
		float: left;
		line-height: .88rem;
	}
	
	 .my_header .top1 {
		width: 40%;
		margin-left: 25%;
		float: left;
		text-align: center;
	}
	

	
	/*查询记录*/
	.jyrecord{
		margin-top: 0px !important;
		width: 100%;
		font-size:0.26rem !important;
	    background-color: #FFFFFF;
		
	}
	.jyrecord .row{
		/*margin-left: 20px;*/
	}

	.jyrecord .row {
		width: 100%;
		height: 0.88rem;
		background-color: #FFFFFF;
		line-height: 0.88rem;
		padding: 0px 0.3rem 0px 0.3rem;		
	}
	
	.jyrecord .row:first-child {
		border-bottom: 1px solid #efefef;
	}
	
	.jyrecord .row .left {
		width: 50%;
		float: left;
		font-size: 0.28rem;
		color: #666666;
	}
	
	.jyrecord .row .right {
		color: #666666;
		width: 50%;
		float: right;
		font-size: 0.28rem;
		line-height: 0.88rem;
		text-align: right;
	}
	
	.jyrecord .row .right img {
		width: 0.14rem;
		height: 0.24rem;
		vertical-align: middle;
		margin-left: 7px;
		margin-bottom: 3px;
	}
	
	.jyrecord .row .right input {
		border: none;
		outline: none;
		text-indent: 4em;
		text-align: right;
		padding-right: 0px !important;
	}
	
</style>